package com.aaa.fpa.service;

import com.aaa.fpa.dao.LogsDao;
import com.aaa.pojo.Log;
import com.aaa.pojo.PageSort;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Version 1.0
 * @Author:w
 * @Date:Created in 2022/7/15
 * @Content:
 * @Description:
 * @Version:
 */
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogsDao logsDao;
    @Override
    public void addLog(Log log) {
        logsDao.addLog(log);
    }

    @Override
    public Page findAll(PageSort pageSort) {
        PageHelper.startPage(pageSort.getPage(), pageSort.getLimit());
        List<Log> logs= logsDao.findAll();
        Page page = (Page) logs;
        return page;
    }
}
